package com.suray.type;

/**
 * 滚筒车滚筒运行方向
 */
public enum RollerDirectionType {
    INVALID(-1, "", "无效"),
    LEFT(1, "Left", "入库/左转"),
    RIGHT(2, "Right", "出库/右转"),
    STOP(3, "Stop", "停止"),
    ;

    private int value;
    private String strValue;
    private String des;

    RollerDirectionType(int value, String strValue, String des) {
        this.value = value;
        this.strValue = strValue;
        this.des = des;
    }

    public int getValue() {
        return value;
    }

    public static RollerDirectionType parseType(int value) {
        for (RollerDirectionType rollerDirectionType : RollerDirectionType.values()) {
            if (rollerDirectionType.value == value) {
                return rollerDirectionType;
            }
        }

        return INVALID;
    }

    public String getStrValue() {
        return strValue;
    }

    @Override
    public String toString() {
        return des;
    }
}
